﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Budgeter.Models;
using Budgeter.ViewModels.Budget;
using Budgeter.Extensions;
using System.Configuration;
using System.Data.EntityClient;
using Budgeter.Helpers;

namespace Budgeter.Controllers
{
    public class ControllerBase : Controller
    {
        private readonly BudgeterContext _db = BudgeterContextHelper.OpenBudgeterContextFromAppConfig();

        protected BudgeterContext BudgeterContext
        {
            get
            {
                return _db;
            }
        }

        protected override void Dispose(bool disposing)
        {
            BudgeterContext.Dispose();
            base.Dispose(disposing);
        }

   }
}